Skip to content

Corrected configuration of exclude statements in pre-commit configuration#104

Merged
Balandat merged 1 commit into
mainfrom
precommit-config
Jan 14, 2025
Merged

Corrected configuration of exclude statements in pre-commit configuration#104
Balandat merged 1 commit into
mainfrom
precommit-config

Conversation

@JonathanWenger

Copy link
Copy Markdown
Collaborator

Description
Currently the pre-commit configuration assumes glob matching in the exclude statements, even though these are assumed to be regular expressions. This causes the exclude statements to match the wrong files and shows warnings when running pre-commit.

[WARNING] The 'exclude' field in hook 'flake8' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'ufmt' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'require-ascii' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'forbid-binary' is a regex, not a glob -- matching '/*' probably isn't what you want here

This PR replaces the glob statements with regular expressions in the pre-commit configuration.

Related Issues
This seems to be a common error and similar PRs have been made to other libraries (e.g. openml/openml-python#1129; cornellius-gp/gpytorch#2541)

@JonathanWenger JonathanWenger self-assigned this Jan 13, 2025

@Balandat Balandat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

globbledygook!

@Balandat Balandat merged commit 68feb8a into main Jan 14, 2025
@Balandat Balandat deleted the precommit-config branch January 14, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants